package service.impl;

import dao.NewsDao;
import factory.SimpleDaoFactory;
import factory.impl.MyqlDaoFactory;
import factory.impl.OracleDaoFactory;
import pojo.News;

/**
 * @version v1.0
 * @Author JieGe
 * @Create 2024-11-30 - 10:41
 */
public class NewsServiceImplTest {

    public static void main(String[] args) {
        NewsDao dao = new OracleDaoFactory().getInstance();
        NewsServiceImpl service = new NewsServiceImpl();
        service.setNewsDao(dao);  //  private NewsDao newsDao = new NewsDaoImpl();

        // 耦合度会降低，这种叫解耦(独立性更强)
        service.save(new News());
    }
}
